#########################################################################################
## 
## Hack Title:    Dropdown menu instead of input field
## Author:        Acid
##
## Description:   If you want to have a predefined dropdown menu instead of an
##		  input field..
##		  If you want to have several predefined dropdown menus duplicate the
##		  following steps and change "info" (be aware of the spelling).
##		  The field "info" is just an example.
##
## Files to edit: 5
##		  language/lang_english/lang_main.php
##		  admin/admin_users.php
##		  includes/usercp_register.php
##                templates/xxx/admin/user_edit_body.tpl
##                templates/xxx/profile_add_body.tpl
##
#########################################################################################
## 
## Installation/Author Notes: 
## First always backup the files that you're going to edit. 
## 
#########################################################################################
# 
#-----[ OPEN ]------------------------------------------
#
# templates/lang_english/lang_main.php
# 
#-----[ FIND ]---------------------------------------------------
# 
$lang['Info'] = 'Info';

# 
#-----[ REPLACE WITH ]---------------------------------------------------
# 
## if youre going to edit the part do not delete the single quotes (') and 
## the first entry (empty). you may change the word "empty" of course.

$lang['Info_choice'] = array('(empty)','Techno','Pop','Funk','Rock','Beat','RockSteady','Classic');



# 
#-----[ OPEN ]------------------------------------------
#  
# includes/usercp_register.php
# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
			$sql = "UPDATE " . USERS_TABLE . "
# 
#-----[ ABOVE ADD ]---------------------------------------------------
# 
               		$info = ($info == $lang['Info_choice']['0']) ? '' : $info;

# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
			$sql = "INSERT INTO " . USERS_TABLE . "
# 
#-----[ ABOVE ADD ]---------------------------------------------------
# 
               		$info = ($info == $lang['Info_choice']['0']) ? '' : $info;

# 
#-----[ FIND ]---------------------------------------------------
# 
	$template->set_filenames(array(
		'body' => 'profile_add_body.tpl')
	);

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
	$s_info = '<select name="info">';
	for($i = 0; $i < count($lang['Info_choice']); $i++ )
	{
	        $s_info .= '<option value="' . $lang['Info_choice'][$i] . '">' . $lang['Info_choice'][$i]. '</option>';
	}
	$s_info .= '</select>'; 
	$s_info = str_replace("value=\"".$info."\">", "value=\"".$info."\" SELECTED>" ,$s_info);

# 
#-----[ FIND ]---------------------------------------------------
# 
		'INFO' => $info,
# 
#-----[ REPLACE WITH ]---------------------------------------------------
# 
		'S_INFO' => $s_info,



# 
#-----[ OPEN ]------------------------------------------
#  
# admin/admin_users.php
# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
			$sql = "UPDATE " . USERS_TABLE . "
# 
#-----[ ABOVE ADD ]---------------------------------------------------
# 
               		$info = ($info == $lang['Info_choice']['0']) ? '' : $info;

# 
#-----[ FIND ]---------------------------------------------------
# 
		$template->set_filenames(array(
			"body" => "admin/user_edit_body.tpl")
		);

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
		$s_info = '<select name="info">';
		for($i = 0; $i < count($lang['Info_choice']); $i++ )
		{
		        $s_info .= '<option value="' . $lang['Info_choice'][$i] . '">' . $lang['Info_choice'][$i]. '</option>';
		}
		$s_info .= '</select>'; 
		$s_info = str_replace("value=\"".$info."\">", "value=\"".$info."\" SELECTED>" ,$s_info);

# 
#-----[ FIND ]---------------------------------------------------
# 
			'INFO' => $info, 

# 
#-----[ REPLACE WITH ]---------------------------------------------------
# 
			'S_INFO' => $s_info, 



# 
#-----[ OPEN ]------------------------------------------
#  
# templates/xxx/admin/user_edit_body.tpl
# templates/xxx/profile_add_body.tpl
# 
#-----[ FIND ]---------------------------------------------------
# 
          <td class="row2"> <input class="post" type="text" name="info" size="35" maxlength="50" value="{INFO}" /> /td> 
# 
#-----[ REPLACE WITH ]---------------------------------------------------
# 
	  <td class="row2"> {S_INFO}  </td>

#########################################################################################
#########################################################################################
#########################################################################################